package com.carb.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.carb.enums.BusinessPayMethod;
import com.carb.enums.BusinessStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 业务实体类
 * </p>
 *
 * @author XuChaoyang
 * @since 2025-01-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_business")
@Schema(description = "业务表")
public class Business implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "业务id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "服务项目id")
    private Long projectId;

    @Schema(description = "员工id")
    private Long employeeId;

    @Schema(description = "会员id")
    private Long memberId;

    @Schema(description = "车辆id")
    private Long carId;

    @Schema(description = "实际服务时长 (单位为分钟)")
    private Integer actualDuration;

    @Schema(description = "应付金额 (单位为分)")
    private Integer payableAmount;

    @Schema(description = "付款方式 (余额, 微信, 支付宝, 现金)")
    private BusinessPayMethod payMethod;

    @Schema(description = "业务状态 (待接单, 进行中, 已完成, 已退款)")
    private BusinessStatus status;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

}
